home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / gr_col.exe / RECOL3.PAS < prev   
Pascal/Delphi Source File  |  1993-04-17  |  2KB  |  77 lines

  1. { == RECOL3.PAS ===============================================================
  2.  
  3.   Utility program to convert color exception files from GR_COL2G.PAS into a
  4.   set of Turbo source statements to build the XorColConv exception table.
  5.  
  6.   This was a "bootstrap" process in that an initial exception table was built
  7.   and "adjusted" visually by examining the output colors to determine which
  8.   "standard" VGA colors went with which XOR "exception" colors.
  9.  
  10.   See the documentation of XorColConv in GR_CON2G.PAS for an explanation of
  11.   the techniques used.
  12.  
  13.   Written by Jerry Rivers. Last modified: 04/16/93
  14.  
  15.   ============================================================================= }
  16.  
  17. program ReCol;
  18.   uses
  19.     Crt;
  20.  
  21.   var
  22.     BkCol : integer;
  23.     Col : integer;
  24.     I, J: integer;
  25.     New : text;
  26.     New2: text;
  27.     S   : string;
  28.     RGB : longint;
  29.     Txt : text;
  30.     Txt2: text;
  31.  
  32.   begin
  33.     assign( Txt, 'coltxt.txt' );
  34.     reset( Txt );
  35.     assign( New, 'coltxt.new' );
  36.     rewrite( New );
  37.  
  38.     assign( Txt2, 'col.txt' );
  39.     reset ( Txt2 );
  40.     assign( New2, 'col.new' );
  41.     rewrite( New2 );
  42.     {
  43.       Read from one of the color diagnostic files, convert to TP statements
  44.       for the color exception table
  45.     }
  46.     I := 1; J := 1;
  47.     while not eof( Txt2 ) do
  48.       begin
  49.         readln( Txt,  S );
  50.         readln( Txt2, BkCol, RGB, Col );
  51.         {
  52.           Only create an exception entry for colors which do not have a
  53.           standard VGA XOR output. These are identified in the 'coltxt.txt'
  54.           file with FALSE at the beginning of each line
  55.         }
  56.         if pos( 'FALSE', S ) <> 0 then
  57.           begin
  58.             writeln( New,  S );
  59.  
  60.             writeln( New2, 'RGB[', J:2, '] := ', RGB:7, ';  ',
  61.                            'Col[', J:2, '] := ', Col:2, ';'    );
  62.             writeln( I, ': ', S );
  63.             inc( J );
  64.           end;
  65.         inc( I );
  66.       end;
  67.  
  68.     close( Txt );
  69.     close( New );
  70.     close( Txt2 );
  71.     close( New2 );
  72.  
  73.     writeln;
  74.     write( 'Press RETURN to quit ');
  75.     readln;
  76.  
  77.   end.